.class public Lcom/xingbook/park/a/s;
.super Landroid/widget/BaseAdapter;


# instance fields
.field a:Lcom/xingbook/d/a;

.field b:[Lcn/a/a/c/a;

.field c:Landroid/graphics/Paint;

.field d:I

.field e:I

.field f:I

.field g:I

.field h:Landroid/graphics/Canvas;

.field i:Lcom/xingbook/c/n;

.field private j:Landroid/content/Context;

.field private k:Landroid/graphics/Matrix;


# direct methods
.method public constructor <init>(Landroid/content/Context;[Lcn/a/a/c/a;)V
    .locals 3

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    invoke-static {p1}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/a/s;->i:Lcom/xingbook/c/n;

    iget-object v0, p0, Lcom/xingbook/park/a/s;->i:Lcom/xingbook/c/n;

    invoke-virtual {v0}, Lcom/xingbook/c/n;->h()Lcom/xingbook/d/a;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/a/s;->a:Lcom/xingbook/d/a;

    iput-object p1, p0, Lcom/xingbook/park/a/s;->j:Landroid/content/Context;

    iput-object p2, p0, Lcom/xingbook/park/a/s;->b:[Lcn/a/a/c/a;

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/park/a/s;->g:I

    iput v0, p0, Lcom/xingbook/park/a/s;->f:I

    iput v0, p0, Lcom/xingbook/park/a/s;->e:I

    iput v0, p0, Lcom/xingbook/park/a/s;->d:I

    new-instance v0, Landroid/graphics/Matrix;

    invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/a/s;->k:Landroid/graphics/Matrix;

    iget-object v0, p0, Lcom/xingbook/park/a/s;->k:Landroid/graphics/Matrix;

    const/high16 v1, 0x3f80

    const/high16 v2, -0x4080

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Matrix;->preScale(FF)Z

    new-instance v0, Landroid/graphics/Canvas;

    invoke-direct {v0}, Landroid/graphics/Canvas;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/a/s;->h:Landroid/graphics/Canvas;

    return-void
.end method

.method private a(I)Landroid/graphics/Bitmap;
    .locals 13

    const/4 v1, 0x0

    :try_start_0
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/xingbook/park/a/s;->a:Lcom/xingbook/d/a;

    invoke-virtual {v2}, Lcom/xingbook/d/a;->s()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-static {v10}, Lcom/xingbook/c/k;->b(Ljava/lang/String;)Landroid/graphics/Bitmap;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v8

    if-nez v8, :cond_3

    :try_start_1
    iget-object v0, p0, Lcom/xingbook/park/a/s;->a:Lcom/xingbook/d/a;

    invoke-virtual {v0, p1}, Lcom/xingbook/d/a;->e(I)Ljava/io/InputStream;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4

    move-result-object v9

    const/4 v0, 0x0

    :try_start_2
    sget-object v1, Lcom/xingbook/c/n;->g:Landroid/graphics/BitmapFactory$Options;

    invoke-static {v9, v0, v1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v11

    iget v0, p0, Lcom/xingbook/park/a/s;->f:I

    if-nez v0, :cond_0

    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    iput v0, p0, Lcom/xingbook/park/a/s;->e:I

    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v0

    iput v0, p0, Lcom/xingbook/park/a/s;->d:I

    iget v0, p0, Lcom/xingbook/park/a/s;->d:I

    div-int/lit8 v0, v0, 0x3

    iput v0, p0, Lcom/xingbook/park/a/s;->f:I

    iget v0, p0, Lcom/xingbook/park/a/s;->d:I

    iget v1, p0, Lcom/xingbook/park/a/s;->f:I

    add-int/2addr v0, v1

    add-int/lit8 v0, v0, 0xa

    iput v0, p0, Lcom/xingbook/park/a/s;->g:I

    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/a/s;->c:Landroid/graphics/Paint;

    new-instance v0, Landroid/graphics/LinearGradient;

    const/4 v1, 0x0

    iget v2, p0, Lcom/xingbook/park/a/s;->d:I

    int-to-float v2, v2

    const/4 v3, 0x0

    iget v4, p0, Lcom/xingbook/park/a/s;->g:I

    int-to-float v4, v4

    const v5, 0x70ffffff

    const v6, 0xffffff

    sget-object v7, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    invoke-direct/range {v0 .. v7}, Landroid/graphics/LinearGradient;-><init>(FFFFIILandroid/graphics/Shader$TileMode;)V

    iget-object v1, p0, Lcom/xingbook/park/a/s;->c:Landroid/graphics/Paint;

    invoke-virtual {v1, v0}, Landroid/graphics/Paint;->setShader(Landroid/graphics/Shader;)Landroid/graphics/Shader;

    iget-object v0, p0, Lcom/xingbook/park/a/s;->c:Landroid/graphics/Paint;

    new-instance v1, Landroid/graphics/PorterDuffXfermode;

    sget-object v2, Landroid/graphics/PorterDuff$Mode;->DST_IN:Landroid/graphics/PorterDuff$Mode;

    invoke-direct {v1, v2}, Landroid/graphics/PorterDuffXfermode;-><init>(Landroid/graphics/PorterDuff$Mode;)V

    invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setXfermode(Landroid/graphics/Xfermode;)Landroid/graphics/Xfermode;

    :cond_0
    const/4 v1, 0x0

    iget v2, p0, Lcom/xingbook/park/a/s;->f:I

    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    iget v4, p0, Lcom/xingbook/park/a/s;->f:I

    iget-object v5, p0, Lcom/xingbook/park/a/s;->k:Landroid/graphics/Matrix;

    const/4 v6, 0x0

    move-object v0, v11

    invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v1

    iget v2, p0, Lcom/xingbook/park/a/s;->g:I

    sget-object v3, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {v1, v2, v3}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_5

    move-result-object v6

    :try_start_3
    iget-object v1, p0, Lcom/xingbook/park/a/s;->h:Landroid/graphics/Canvas;

    invoke-virtual {v1, v6}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    iget-object v1, p0, Lcom/xingbook/park/a/s;->h:Landroid/graphics/Canvas;

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-virtual {v1, v11, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    iget-object v1, p0, Lcom/xingbook/park/a/s;->h:Landroid/graphics/Canvas;

    const/4 v2, 0x0

    iget v3, p0, Lcom/xingbook/park/a/s;->d:I

    add-int/lit8 v3, v3, 0xa

    int-to-float v3, v3

    const/4 v4, 0x0

    invoke-virtual {v1, v0, v2, v3, v4}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V

    iget-object v0, p0, Lcom/xingbook/park/a/s;->h:Landroid/graphics/Canvas;

    const/4 v1, 0x0

    iget v2, p0, Lcom/xingbook/park/a/s;->d:I

    int-to-float v2, v2

    invoke-virtual {v11}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    int-to-float v3, v3

    iget v4, p0, Lcom/xingbook/park/a/s;->g:I

    int-to-float v4, v4

    iget-object v5, p0, Lcom/xingbook/park/a/s;->c:Landroid/graphics/Paint;

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->drawRect(FFFFLandroid/graphics/Paint;)V

    invoke-static {v10, v6}, Lcom/xingbook/c/k;->a(Ljava/lang/String;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_6

    move-result-object v0

    :goto_0
    if-eqz v9, :cond_1

    :try_start_4
    invoke-virtual {v9}, Ljava/io/InputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_3

    :cond_1
    :goto_1
    return-object v0

    :catch_0
    move-exception v0

    move-object v2, v1

    move-object v12, v1

    move-object v1, v0

    move-object v0, v12

    :goto_2
    :try_start_5
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    if-eqz v2, :cond_1

    :try_start_6
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1

    goto :goto_1

    :catch_1
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_1

    :catchall_0
    move-exception v0

    move-object v9, v1

    :goto_3
    if-eqz v9, :cond_2

    :try_start_7
    invoke-virtual {v9}, Ljava/io/InputStream;->close()V
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_2

    :cond_2
    :goto_4
    throw v0

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_4

    :catch_3
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_1

    :catchall_1
    move-exception v0

    goto :goto_3

    :catchall_2
    move-exception v0

    move-object v9, v2

    goto :goto_3

    :catch_4
    move-exception v0

    move-object v2, v1

    move-object v1, v0

    move-object v0, v8

    goto :goto_2

    :catch_5
    move-exception v0

    move-object v1, v0

    move-object v2, v9

    move-object v0, v8

    goto :goto_2

    :catch_6
    move-exception v0

    move-object v1, v0

    move-object v2, v9

    move-object v0, v6

    goto :goto_2

    :cond_3
    move-object v0, v8

    move-object v9, v1

    goto :goto_0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/a/s;->b:[Lcn/a/a/c/a;

    array-length v0, v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/a/s;->b:[Lcn/a/a/c/a;

    aget-object v0, v0, p1

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 3

    if-nez p2, :cond_1

    iget-object v0, p0, Lcom/xingbook/park/a/s;->j:Landroid/content/Context;

    const v1, 0x7f030014

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    new-instance v1, Lcom/xingbook/park/a/t;

    invoke-direct {v1, p0}, Lcom/xingbook/park/a/t;-><init>(Lcom/xingbook/park/a/s;)V

    const v0, 0x7f0a00c6

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/xingbook/park/a/t;->a:Landroid/widget/ImageView;

    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    move-object v0, v1

    :goto_0
    iget-object v1, p0, Lcom/xingbook/park/a/s;->b:[Lcn/a/a/c/a;

    aget-object v1, v1, p1

    invoke-virtual {v1}, Lcn/a/a/c/a;->c()I

    move-result v1

    invoke-direct {p0, v1}, Lcom/xingbook/park/a/s;->a(I)Landroid/graphics/Bitmap;

    move-result-object v1

    if-eqz v1, :cond_0

    iget-object v0, v0, Lcom/xingbook/park/a/t;->a:Landroid/widget/ImageView;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    :cond_0
    return-object p2

    :cond_1
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/a/t;

    goto :goto_0
.end method
